<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>v-show使用</title>
  </head>
  <body>
    <div id="app">
      <!-- v-if:当条件为false时，包含v-if指令的元素，从demo中删除 -->
      <h2 v-if="istrue" id="if">{{message}}</h2>
      <!-- v-show：当条件为false时，v-show只是给我们的元素添加一个行内样式：display：none -->
      <h2 v-show="istrue" id="show">{{message}}</h2>
    </div>
    <script src="../vue.js"></script>
    <script>
      const app = new Vue({
        el: "#app",
        data: {
          message: "hello",
          istrue: true,
        },
      });
    </script>
  </body>
</html>
